package com.ezops.poc.bo;

import java.io.Serializable;

/**
 * The current data flow is dymanic in nature, so static modeling will require
 * changes at lots of places, Prefer this model if you have changing fields.
 * 
 * @author vgaurav
 * 
 */
public interface DynamicModel extends Iterable<DynamicModel.Field> , Serializable{

	public String[] getHeaders();

	public void addField(String fieldName, String fieldValue);

	public String getField(String fieldName);

	/** ---------------------------INNER CLASS FIELD--------------------------- */
	/**
	 * Class representing each individual field from the file, for each record.
	 * 
	 * @author vgaurav
	 * 
	 */
	public static class Field implements Serializable{

		/**
		 * 
		 */
		private static final long serialVersionUID = 1L;

		String name;

		String value;

		static Field getInstance(String fieldName, String fieldValue) {
			Field field = new Field();
			field.name = fieldName;
			field.value = fieldValue;
			return field;
		}

		public String getName() {
			return name;
		}

		public String getValue() {
			return value;
		}

	}

}
